﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
/*
namespace TagSpider
{
    class TagDownloadLog
    {
        public TagDownloadLog()
        {
            m_mutex             = new Mutex();
            m_mutexTotalSpided  = new Mutex();
            m_mutexTimeExec     = new Mutex();

            reset();
        }

        public void reset()
        {
            // 上锁
            m_mutex.WaitOne();

            m_totalSpided   = 0;
            m_timeExec      = TimeSpan.Zero;

            // 解锁
            m_mutex.ReleaseMutex();
        }

        #region TotalSpided
        private int m_totalSpided;
        public int TotalSpided
        {
            get { return m_totalSpided; }
        }
        public void incTotalSpided()
        {
            // 上锁
            m_mutexTotalSpided.WaitOne();

            m_totalSpided++;

            // 解锁
            m_mutexTotalSpided.ReleaseMutex();
        }
        #endregion

        #region timeExec
        private TimeSpan m_timeExec;
        private DateTime m_timeStart;
        public TimeSpan TimeExec
        {
            get { return m_timeExec; }
        }
        public DateTime TimeStart
        {
            get { return m_timeStart; }
        }
        public void setStartTime(DateTime startTime)
        {
            m_timeStart = startTime;
        }
        public void addMoreTime(DateTime curTime)
        {
            // 上锁
            m_mutexTimeExec.WaitOne();

            m_timeExec += curTime - m_timeStart;

            // 解锁
            m_mutexTimeExec.ReleaseMutex();
        }
        #endregion

        private Mutex m_mutex;
        private Mutex m_mutexTotalSpided;
        private Mutex m_mutexTimeExec;
    }
}
 * */
